    <!--头部 -->
    {include file="common/admin_header.html"}
    <!--头部 -->
    <!--顶部导航 -->
    {include file="common/top_nav.html"}
    <!--顶部导航 -->

    <!--左侧导航 -->
    {include file="common/left_nav.html"}
    <!--左侧导航 -->
    <style>
        .form-control{
            width: 40%;
        }
    </style>
        </section>
        <section class="content">
            <div class="">
                <div  class="">
                    <div class="box box-success">
                        <div class="box-header with-border">
                            <h3 class="box-title">{if $a=='add'}添加{else}编辑{/if}文章</h3>
                        </div>
                        <!-- 数据的显示 -->
                        <div class="box-body" id="data-list">
                            <form enctype="multipart/form-data" method="post" action="">
                            <div class="form-group">
                                <label class="item-label">文章分类</label>
                                <select class="form-control" name="cat_id" id="cat_id">

                                    <option value="0">请选择</option>
                                    {foreach from=$catname item=cat_info}
                                    <option  style="margin-left:{$cat_info.level}em" value='{$cat_info.cat_id}'{if $data.cat_id eq $cat_info.cat_id}selected{/if}>{$cat_info.html}{$cat_info.cat_name}</option>
                                    {/foreach}
                                </select>
                            </div>
                            <div class="form-group item_title ">
                                <label >文章标题</label>
                                <div class="controls">
                                    <input type="text" name="title" id="title" value="{$data.title}" placeholder="文章标题" class="form-control input text">
                                </div>
                            </div>
                            <div class="form-group item_title ">
                                <label class="item-label">文章的重要性</label>
                                <select class="form-control" name="article_type" id="article_type">
                                    <option value="1" {if $data.article_type eq 1}selected{/if}>置顶</option>
                                    <option value="0" {if $data.article_type eq 0}selected{/if}>普通</option>
                                </select>
                            </div>
                                <div class="form-group">
                                    <label class="item-label">是否显示</label>
                                    <select class="form-control" name="is_open" id="is_open">
                                        <option value="1" {if $data.is_open eq 1}selected{/if}>是</option>
                                        <option value="0" {if $data.is_open eq 0}selected{/if}>否</option>
                                    </select>
                                </div>
                                <div class="form-group">
                                    <label class="item-label">文章作者</label>
                                    <div class="controls">
                                        <input type="text" name="author" id="author" value="{$data.author}" placeholder="文章作者" class="form-control input text"/>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="item-label">作者Email</label>
                                    <div class="controls">
                                        <input type="text" name="author_email" id="author_email" value="{$data.author_email}" placeholder="作者Email" class="form-control input text"/>
                                    </div>
                                </div>
                                <div class="form-gourp">
                                    <label class="item-label">关键字</label>
                                    <div class="controls">
                                        <input type="text" name="keywords" id="keywords" placeholder="关键字" value="{$data.keywords}" class="form-control input text"/>
                                    </div>
                                </div>
                                <br>
                                <div class="form-group">
                                    <label class="item-label">网页描述</label>
                                    <div class="controls">
                                        <textarea name="description" id="description" cols="68" placeholder="网页描述" rows="5">{$data.description}</textarea>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="item-label">外部链接</label>
                                    <div class="controls">
                                        <input type="text" id="link" name="link" value="{$data.link}" class="form-control input text" placeholder="http://">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="item-label">会议时间</label>
                                    <div class="controls">
                                    <!--id="start_time"不能动,只有这个ID才能获取到时间插件-->
                                    <input type="text" id="start_time" name="add_time" value="{$data.add_time}" class="input-default form-control" placeholder="会议时间">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="item-label">地区</label>
                                    <div class="controls">
                                        <input type="text" id="address" name="address" value="{$data.address}" class="form-control input text" placeholder="地区">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="item-label">详细地址</label>
                                    <div class="controls">
                                        <input type="text" id="xxdz" name="xxdz" value="{$data.xxdz}" class="form-control input text" placeholder="详细地址">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="item-label">上传图片</label>
                                    <div class="controls">
                                        <input type="file" id="file_url" name="file_url" class="file-3" multiple=true>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="item-label">上传文件</label>
                                    <div class="controls">
                                        <input type="file" id="file_url1" name="file_url1" class="file-4" multiple=true>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <input type="hidden"  value="{$data.article_id}" name="article_id" id="article_id">
                                    <button target-form="builder-form" type="submit" class="btn btn-primary">确定</button>
                                    <button onclick="javascript:history.back(-1);return false;" class="btn btn-default return visible-md-inline visible-lg-inline">返回</button>
                                </div>
                            </form>

                        </div>
                    </div>
                </div>
            </div>
        </section>
    </div>
    {include file="common/admin_footer.html"}
    <script>
        //这是JS 封装的类 用于获取地址栏的参数
        function GetQueryString(name)
        {
            var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
            var r = window.location.search.substr(1).match(reg);
            if(r!=null)return  unescape(r[2]); return null;
        }
        $(function(){
            $('#img_id').val(GetQueryString('img_id'));
            $(".file-3").fileinput({
                showUpload: false,
                showCaption: false,
                browseClass: "btn btn-primary btn-lg",
                allowedFileExtensions : ['jpg', 'png','gif','jpeg'],
//                fileType: "any",
                previewFileIcon: "<i class='glyphicon glyphicon-king'></i>"
            });
            $(".file-4").fileinput({
                showUpload: false,
                showCaption: false,
                browseClass: "btn btn-primary btn-lg",
                allowedFileExtensions : ['bmp','swf','doc','xls','ppt','mid','wav','zip','rar','pdf','chm','rm','txt','docx','xlsx'],
//                fileType: "any",
                previewFileIcon: "<i class='glyphicon glyphicon-king'></i>"
            });
            $(document).ready(function() {
                $("#test-upload").fileinput({
                    'showPreview' : false,
                    'allowedFileExtensions' : ['jpg', 'png','gif'],
                    'elErrorContainer': '#errorBlock'
                });
            });

        });
    </script>
